package com.edu.contorller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/user")
public class UserController {

    @RequestMapping(value="/login",method={RequestMethod.POST},params = {"username","password"})
    public String login(){
        System.out.println("执行了登录");
        //return 后面的 斜杠 表示从 项目的根目录出发 SpringMVC03/
        return "/index.jsp";
    }

    @PostMapping(value="/register",params = {"username"})
    public String register(){
        System.out.println("执行了注册");
        return "/index.jsp";
    }
}
